package com.ts.store.beans;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

/**
 * @author wanglei
 * on 2020/4/8
 */
public class StorageService {
    private Logger logger = Logger.getLogger(StorageService.class.getName());

    private String url;
    private String userName;
    private String password;
    private Map<String, Object> store = new HashMap<String, Object>();

    public StorageService(StorageProperties storageProperties) {
        this.url = storageProperties.getUrl();
        this.userName = storageProperties.getUserName();
        this.password = storageProperties.getPassword();
        logger.info("Init Storage Service OK, url:" + url
                + ", password:" + password + ", name:" + userName);
    }

    public void put(String key, Object value) {
        store.put(key, value);
    }

    public Object get(String key) {
        return store.get(key);
    }

}
